	
////根据密码判断强度
function validatePwd(pwd){ 
		//弱 
		var week = /^(?:\d+|[a-zA-Z]+|[!@#$%^&*]+)$/;
	    //中：字母+数字  
	    var middle1 = /^(?!\d+$)(?![a-zA-Z]+$)[a-zA-Z\d]+$/;  
	    //中：字母+字符  
	    var middle2 = /^(?!((?=[\x21-\x7e]+)[^A-Za-z0-9])+$)(?![a-zA-Z]+$)[^\u4e00-\u9fa5\d]{8,16}$/;  
	    //中：数字+字符  
	    var middle3 = /^(?!((?=[\x21-\x7e]+)[^A-Za-z0-9])+$)(?!\d+$)[^\u4e00-\u9fa5a-zA-Z]{8,16}$/;  
	    //强  
	    var strong = /^(?!\d+$)(?![a-zA-Z]+$)(?![@#$%^&]+$)[\da-zA-Z@#$%^&]+$/;  
	    

	    if(week.test(pwd)){	    	
	    	$("#pwdStrength").html("弱")
	    }else if(middle1.test(pwd)||middle2.test(pwd)||middle3.test(pwd)){
	    	$("#pwdStrength").html("中")
	    }else if(strong.test(pwd)){
	    	$("#pwdStrength").html("强")	    	
	    }else{
	    	//其他情况（密码包含'.'等其他特殊字符）
	    	$("#pwdStrength").html("强")	    		    	
	    }	    
	}

//获取邮箱和密码
$(function(){
	var model;
	$.ajax({
		url:'/web-adv/gainEmailAndPwd',
		type:"POST",
		dataType:"json",
		success : function(data){			
			$("#email").html(data.newMail);
			//根据密码判断强度
		      var pwd=data.pwd;
		      validatePwd(pwd);
			
		},
		error : function(){
			console.log("err");
		}
	})
})
